package com.dt.platform.domain.oa;

import com.github.foxnic.dao.entity.Entity;
import io.swagger.annotations.ApiModel;
import javax.persistence.Table;
import com.github.foxnic.sql.meta.DBTable;
import com.dt.platform.constants.db.OaTables.OA_PROJECT_TASK_RCD;
import io.swagger.annotations.ApiModelProperty;
import java.util.Date;
import javax.persistence.Transient;
import com.github.foxnic.api.swagger.EnumFor;
import javax.persistence.Id;
import java.math.BigDecimal;
import org.github.foxnic.web.domain.hrm.Employee;
import org.github.foxnic.web.domain.system.DictItem;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.github.foxnic.commons.lang.DataParser;
import java.util.Map;
import com.github.foxnic.dao.entity.EntityContext;
import com.dt.platform.domain.oa.meta.ProjectTaskRcdMeta;
import com.github.foxnic.sql.data.ExprRcd;



/**
 * 工作记录
 * <p>工作记录 , 数据表 oa_project_task_rcd 的PO类型</p>
 * @author 金杰 , maillank@qq.com
 * @since 2025-07-06 17:04:56
 * @sign 919A43C7E0E70AF6C3D5E2C78619CE65
 * 此文件由工具自动生成，请勿修改。若表结构或配置发生变动，请使用工具重新生成。
*/

@Table(name = "oa_project_task_rcd")
@ApiModel(description = "工作记录 ; 工作记录 , 数据表 oa_project_task_rcd 的PO类型")
public class ProjectTaskRcd extends Entity {

	private static final long serialVersionUID = 1L;

	public static final DBTable TABLE =OA_PROJECT_TASK_RCD.$TABLE;
	
	/**
	 * 创建人ID：创建人ID
	*/
	@ApiModelProperty(required = false,value="创建人ID" , notes = "创建人ID" , example = "110588348101165911")
	private String createBy;
	
	/**
	 * 创建时间：创建时间
	*/
	@ApiModelProperty(required = false,value="创建时间" , notes = "创建时间" , example = "2025-06-30 02:28:34")
	private Date createTime;
	
	/**
	 * 工作内容：工作内容
	*/
	@ApiModelProperty(required = false,value="工作内容" , notes = "工作内容" , example = "12")
	private String ct;
	
	/**
	 * 删除人ID：删除人ID
	*/
	@ApiModelProperty(required = false,value="删除人ID" , notes = "删除人ID")
	private String deleteBy;
	
	/**
	 * 删除时间：删除时间
	*/
	@ApiModelProperty(required = false,value="删除时间" , notes = "删除时间")
	private Date deleteTime;
	
	/**
	 * 是否已删除：是否已删除
	*/
	@ApiModelProperty(required = true,value="是否已删除" , notes = "是否已删除" , example = "0")
	private Integer deleted;
	@Transient
	@EnumFor("deleted")
	private Boolean deletedBool;
	
	/**
	 * 结束时间：结束时间
	*/
	@ApiModelProperty(required = false,value="结束时间" , notes = "结束时间" , example = "2025-06-30 02:30:31")
	private Date eTime;
	
	/**
	 * 附件：附件
	*/
	@ApiModelProperty(required = false,value="附件" , notes = "附件")
	private String fileId;
	
	/**
	 * 主键：主键
	*/
	@Id
	@ApiModelProperty(required = true,value="主键" , notes = "主键" , example = "709376396413108229")
	private String id;
	
	/**
	 * 补充描述：补充描述
	*/
	@ApiModelProperty(required = false,value="补充描述" , notes = "补充描述" , example = "1212")
	private String notes;
	
	/**
	 * 创建人员：创建人员
	*/
	@ApiModelProperty(required = false,value="创建人员" , notes = "创建人员" , example = "E001")
	private String ownerId;
	
	/**
	 * 关联项目：关联项目
	*/
	@ApiModelProperty(required = false,value="关联项目" , notes = "关联项目" , example = "709328085530443781")
	private String projectId;
	
	/**
	 * 开始时间：开始时间
	*/
	@ApiModelProperty(required = false,value="开始时间" , notes = "开始时间" , example = "2025-06-30 02:28:31")
	private Date sTime;
	
	/**
	 * 人员状态：人员状态
	*/
	@ApiModelProperty(required = false,value="人员状态" , notes = "人员状态")
	private String status;
	
	/**
	 * 关联任务：关联任务
	*/
	@ApiModelProperty(required = false,value="关联任务" , notes = "关联任务" , example = "709328307572703237")
	private String taskId;
	
	/**
	 * 修改人ID：修改人ID
	*/
	@ApiModelProperty(required = false,value="修改人ID" , notes = "修改人ID" , example = "110588348101165911")
	private String updateBy;
	
	/**
	 * 修改时间：修改时间
	*/
	@ApiModelProperty(required = false,value="修改时间" , notes = "修改时间" , example = "2025-06-30 02:28:59")
	private Date updateTime;
	
	/**
	 * version：version
	*/
	@ApiModelProperty(required = false,value="version" , notes = "version" , example = "2")
	private Integer version;
	
	/**
	 * 工作类型：工作类型
	*/
	@ApiModelProperty(required = false,value="工作类型" , notes = "工作类型" , example = "desk")
	private String workCatalog;
	
	/**
	 * 实际工时：实际工时
	*/
	@ApiModelProperty(required = false,value="实际工时" , notes = "实际工时" , example = "0.03")
	private BigDecimal workTime;
	
	/**
	 * 工作类别：工作类别
	*/
	@ApiModelProperty(required = false,value="工作类别" , notes = "工作类别" , example = "cjhy")
	private String workType;
	
	/**
	 * owner：owner
	*/
	@ApiModelProperty(required = false,value="owner" , notes = "owner")
	private Employee owner;
	
	/**
	 * workTypeDict：workTypeDict
	*/
	@ApiModelProperty(required = false,value="workTypeDict" , notes = "workTypeDict")
	private DictItem workTypeDict;
	
	/**
	 * project：project
	*/
	@ApiModelProperty(required = false,value="project" , notes = "project")
	private Project project;
	
	/**
	 * task：task
	*/
	@ApiModelProperty(required = false,value="task" , notes = "task")
	private ProjectTask task;
	
	/**
	 * selectRange：selectRange
	*/
	@ApiModelProperty(required = false,value="selectRange" , notes = "selectRange")
	private String selectRange;
	
	/**
	 * tabStatus：tabStatus
	*/
	@ApiModelProperty(required = false,value="tabStatus" , notes = "tabStatus")
	private String tabStatus;
	
	/**
	 * 获得 创建人ID<br>
	 * 创建人ID
	 * @return 创建人ID
	*/
	public String getCreateBy() {
		return createBy;
	}
	
	/**
	 * 设置 创建人ID
	 * @param createBy 创建人ID
	 * @return 当前对象
	*/
	public ProjectTaskRcd setCreateBy(String createBy) {
		this.createBy=createBy;
		return this;
	}
	
	/**
	 * 获得 创建时间<br>
	 * 创建时间
	 * @return 创建时间
	*/
	public Date getCreateTime() {
		return createTime;
	}
	
	/**
	 * 设置 创建时间
	 * @param createTime 创建时间
	 * @return 当前对象
	*/
	public ProjectTaskRcd setCreateTime(Date createTime) {
		this.createTime=createTime;
		return this;
	}
	
	/**
	 * 获得 工作内容<br>
	 * 工作内容
	 * @return 工作内容
	*/
	public String getCt() {
		return ct;
	}
	
	/**
	 * 设置 工作内容
	 * @param ct 工作内容
	 * @return 当前对象
	*/
	public ProjectTaskRcd setCt(String ct) {
		this.ct=ct;
		return this;
	}
	
	/**
	 * 获得 删除人ID<br>
	 * 删除人ID
	 * @return 删除人ID
	*/
	public String getDeleteBy() {
		return deleteBy;
	}
	
	/**
	 * 设置 删除人ID
	 * @param deleteBy 删除人ID
	 * @return 当前对象
	*/
	public ProjectTaskRcd setDeleteBy(String deleteBy) {
		this.deleteBy=deleteBy;
		return this;
	}
	
	/**
	 * 获得 删除时间<br>
	 * 删除时间
	 * @return 删除时间
	*/
	public Date getDeleteTime() {
		return deleteTime;
	}
	
	/**
	 * 设置 删除时间
	 * @param deleteTime 删除时间
	 * @return 当前对象
	*/
	public ProjectTaskRcd setDeleteTime(Date deleteTime) {
		this.deleteTime=deleteTime;
		return this;
	}
	
	/**
	 * 获得 是否已删除<br>
	 * 是否已删除
	 * @return 是否已删除
	*/
	public Integer getDeleted() {
		return deleted;
	}
	
	/**
	 * 获得 是否已删除 的投影属性<br>
	 * 等价于 getDeleted 方法，获得对应的枚举类型
	 * @return 是否已删除
	*/
	@Transient
	public Boolean isDeleted() {
		if(this.deletedBool==null) {
			this.deletedBool=DataParser.parseBoolean(deleted);
		}
		return this.deletedBool ;
	}
	
	/**
	 * 设置 是否已删除
	 * @param deleted 是否已删除
	 * @return 当前对象
	*/
	@JsonProperty("deleted")
	public ProjectTaskRcd setDeleted(Integer deleted) {
		this.deleted=deleted;
		this.deletedBool=DataParser.parseBoolean(deleted);
		return this;
	}
	
	/**
	 * 设置 是否已删除的投影属性，等同于设置 是否已删除
	 * @param deletedBool 是否已删除
	 * @return 当前对象
	*/
	@Transient
	public ProjectTaskRcd setDeleted(Boolean deletedBool) {
		if(deletedBool==null) {
			this.deleted=null;
		} else {
			this.deleted=deletedBool?1:0;
		}
		this.deletedBool=deletedBool;
		return this;
	}
	
	/**
	 * 获得 结束时间<br>
	 * 结束时间
	 * @return 结束时间
	*/
	public Date getETime() {
		return eTime;
	}
	
	/**
	 * 设置 结束时间
	 * @param eTime 结束时间
	 * @return 当前对象
	*/
	public ProjectTaskRcd setETime(Date eTime) {
		this.eTime=eTime;
		return this;
	}
	
	/**
	 * 获得 附件<br>
	 * 附件
	 * @return 附件
	*/
	public String getFileId() {
		return fileId;
	}
	
	/**
	 * 设置 附件
	 * @param fileId 附件
	 * @return 当前对象
	*/
	public ProjectTaskRcd setFileId(String fileId) {
		this.fileId=fileId;
		return this;
	}
	
	/**
	 * 获得 主键<br>
	 * 主键
	 * @return 主键
	*/
	public String getId() {
		return id;
	}
	
	/**
	 * 设置 主键
	 * @param id 主键
	 * @return 当前对象
	*/
	public ProjectTaskRcd setId(String id) {
		this.id=id;
		return this;
	}
	
	/**
	 * 获得 补充描述<br>
	 * 补充描述
	 * @return 补充描述
	*/
	public String getNotes() {
		return notes;
	}
	
	/**
	 * 设置 补充描述
	 * @param notes 补充描述
	 * @return 当前对象
	*/
	public ProjectTaskRcd setNotes(String notes) {
		this.notes=notes;
		return this;
	}
	
	/**
	 * 获得 创建人员<br>
	 * 创建人员
	 * @return 创建人员
	*/
	public String getOwnerId() {
		return ownerId;
	}
	
	/**
	 * 设置 创建人员
	 * @param ownerId 创建人员
	 * @return 当前对象
	*/
	public ProjectTaskRcd setOwnerId(String ownerId) {
		this.ownerId=ownerId;
		return this;
	}
	
	/**
	 * 获得 关联项目<br>
	 * 关联项目
	 * @return 关联项目
	*/
	public String getProjectId() {
		return projectId;
	}
	
	/**
	 * 设置 关联项目
	 * @param projectId 关联项目
	 * @return 当前对象
	*/
	public ProjectTaskRcd setProjectId(String projectId) {
		this.projectId=projectId;
		return this;
	}
	
	/**
	 * 获得 开始时间<br>
	 * 开始时间
	 * @return 开始时间
	*/
	public Date getSTime() {
		return sTime;
	}
	
	/**
	 * 设置 开始时间
	 * @param sTime 开始时间
	 * @return 当前对象
	*/
	public ProjectTaskRcd setSTime(Date sTime) {
		this.sTime=sTime;
		return this;
	}
	
	/**
	 * 获得 人员状态<br>
	 * 人员状态
	 * @return 人员状态
	*/
	public String getStatus() {
		return status;
	}
	
	/**
	 * 设置 人员状态
	 * @param status 人员状态
	 * @return 当前对象
	*/
	public ProjectTaskRcd setStatus(String status) {
		this.status=status;
		return this;
	}
	
	/**
	 * 获得 关联任务<br>
	 * 关联任务
	 * @return 关联任务
	*/
	public String getTaskId() {
		return taskId;
	}
	
	/**
	 * 设置 关联任务
	 * @param taskId 关联任务
	 * @return 当前对象
	*/
	public ProjectTaskRcd setTaskId(String taskId) {
		this.taskId=taskId;
		return this;
	}
	
	/**
	 * 获得 修改人ID<br>
	 * 修改人ID
	 * @return 修改人ID
	*/
	public String getUpdateBy() {
		return updateBy;
	}
	
	/**
	 * 设置 修改人ID
	 * @param updateBy 修改人ID
	 * @return 当前对象
	*/
	public ProjectTaskRcd setUpdateBy(String updateBy) {
		this.updateBy=updateBy;
		return this;
	}
	
	/**
	 * 获得 修改时间<br>
	 * 修改时间
	 * @return 修改时间
	*/
	public Date getUpdateTime() {
		return updateTime;
	}
	
	/**
	 * 设置 修改时间
	 * @param updateTime 修改时间
	 * @return 当前对象
	*/
	public ProjectTaskRcd setUpdateTime(Date updateTime) {
		this.updateTime=updateTime;
		return this;
	}
	
	/**
	 * 获得 version<br>
	 * version
	 * @return version
	*/
	public Integer getVersion() {
		return version;
	}
	
	/**
	 * 设置 version
	 * @param version version
	 * @return 当前对象
	*/
	public ProjectTaskRcd setVersion(Integer version) {
		this.version=version;
		return this;
	}
	
	/**
	 * 获得 工作类型<br>
	 * 工作类型
	 * @return 工作类型
	*/
	public String getWorkCatalog() {
		return workCatalog;
	}
	
	/**
	 * 设置 工作类型
	 * @param workCatalog 工作类型
	 * @return 当前对象
	*/
	public ProjectTaskRcd setWorkCatalog(String workCatalog) {
		this.workCatalog=workCatalog;
		return this;
	}
	
	/**
	 * 获得 实际工时<br>
	 * 实际工时
	 * @return 实际工时
	*/
	public BigDecimal getWorkTime() {
		return workTime;
	}
	
	/**
	 * 设置 实际工时
	 * @param workTime 实际工时
	 * @return 当前对象
	*/
	public ProjectTaskRcd setWorkTime(BigDecimal workTime) {
		this.workTime=workTime;
		return this;
	}
	
	/**
	 * 获得 工作类别<br>
	 * 工作类别
	 * @return 工作类别
	*/
	public String getWorkType() {
		return workType;
	}
	
	/**
	 * 设置 工作类别
	 * @param workType 工作类别
	 * @return 当前对象
	*/
	public ProjectTaskRcd setWorkType(String workType) {
		this.workType=workType;
		return this;
	}
	
	/**
	 * 获得 owner<br>
	 * owner
	 * @return owner
	*/
	public Employee getOwner() {
		return owner;
	}
	
	/**
	 * 设置 owner
	 * @param owner owner
	 * @return 当前对象
	*/
	public ProjectTaskRcd setOwner(Employee owner) {
		this.owner=owner;
		return this;
	}
	
	/**
	 * 获得 workTypeDict<br>
	 * workTypeDict
	 * @return workTypeDict
	*/
	public DictItem getWorkTypeDict() {
		return workTypeDict;
	}
	
	/**
	 * 设置 workTypeDict
	 * @param workTypeDict workTypeDict
	 * @return 当前对象
	*/
	public ProjectTaskRcd setWorkTypeDict(DictItem workTypeDict) {
		this.workTypeDict=workTypeDict;
		return this;
	}
	
	/**
	 * 获得 project<br>
	 * project
	 * @return project
	*/
	public Project getProject() {
		return project;
	}
	
	/**
	 * 设置 project
	 * @param project project
	 * @return 当前对象
	*/
	public ProjectTaskRcd setProject(Project project) {
		this.project=project;
		return this;
	}
	
	/**
	 * 获得 task<br>
	 * task
	 * @return task
	*/
	public ProjectTask getTask() {
		return task;
	}
	
	/**
	 * 设置 task
	 * @param task task
	 * @return 当前对象
	*/
	public ProjectTaskRcd setTask(ProjectTask task) {
		this.task=task;
		return this;
	}
	
	/**
	 * 获得 selectRange<br>
	 * selectRange
	 * @return selectRange
	*/
	public String getSelectRange() {
		return selectRange;
	}
	
	/**
	 * 设置 selectRange
	 * @param selectRange selectRange
	 * @return 当前对象
	*/
	public ProjectTaskRcd setSelectRange(String selectRange) {
		this.selectRange=selectRange;
		return this;
	}
	
	/**
	 * 获得 tabStatus<br>
	 * tabStatus
	 * @return tabStatus
	*/
	public String getTabStatus() {
		return tabStatus;
	}
	
	/**
	 * 设置 tabStatus
	 * @param tabStatus tabStatus
	 * @return 当前对象
	*/
	public ProjectTaskRcd setTabStatus(String tabStatus) {
		this.tabStatus=tabStatus;
		return this;
	}

	/**
	 * 将自己转换成指定类型的PO
	 * @param poType  PO类型
	 * @return ProjectTaskRcd , 转换好的 ProjectTaskRcd 对象
	*/
	@Transient
	public <T extends Entity> T toPO(Class<T> poType) {
		return EntityContext.create(poType, this);
	}

	/**
	 * 将自己转换成任意指定类型
	 * @param pojoType  Pojo类型
	 * @return ProjectTaskRcd , 转换好的 PoJo 对象
	*/
	@Transient
	public <T> T toPojo(Class<T> pojoType) {
		if(Entity.class.isAssignableFrom(pojoType)) {
			return (T)this.toPO((Class<Entity>)pojoType);
		}
		try {
			T pojo=pojoType.newInstance();
			EntityContext.copyProperties(pojo, this);
			return pojo;
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
	}

	/**
	 * 克隆当前对象
	*/
	@Transient
	public ProjectTaskRcd clone() {
		return duplicate(true);
	}

	/**
	 * 复制当前对象
	 * @param all 是否复制全部属性，当 false 时，仅复制来自数据表的属性
	*/
	@Transient
	public ProjectTaskRcd duplicate(boolean all) {
		com.dt.platform.domain.oa.meta.ProjectTaskRcdMeta.$$proxy$$ inst = new com.dt.platform.domain.oa.meta.ProjectTaskRcdMeta.$$proxy$$();
		inst.setNotes(this.getNotes());
		inst.setETime(this.getETime());
		inst.setUpdateTime(this.getUpdateTime());
		inst.setOwnerId(this.getOwnerId());
		inst.setVersion(this.getVersion());
		inst.setWorkTime(this.getWorkTime());
		inst.setCt(this.getCt());
		inst.setCreateBy(this.getCreateBy());
		inst.setDeleted(this.getDeleted());
		inst.setCreateTime(this.getCreateTime());
		inst.setDeleteTime(this.getDeleteTime());
		inst.setUpdateBy(this.getUpdateBy());
		inst.setWorkType(this.getWorkType());
		inst.setDeleteBy(this.getDeleteBy());
		inst.setId(this.getId());
		inst.setSTime(this.getSTime());
		inst.setProjectId(this.getProjectId());
		inst.setTaskId(this.getTaskId());
		inst.setWorkCatalog(this.getWorkCatalog());
		inst.setFileId(this.getFileId());
		inst.setStatus(this.getStatus());
		if(all) {
			inst.setOwner(this.getOwner());
			inst.setTask(this.getTask());
			inst.setSelectRange(this.getSelectRange());
			inst.setProject(this.getProject());
			inst.setWorkTypeDict(this.getWorkTypeDict());
			inst.setTabStatus(this.getTabStatus());
		}
		inst.clearModifies();
		return inst;
	}

	/**
	 * 克隆当前对象
	*/
	@Transient
	public ProjectTaskRcd clone(boolean deep) {
		return EntityContext.clone(ProjectTaskRcd.class,this,deep);
	}

	/**
	 * 将 Map 转换成 ProjectTaskRcd
	 * @param projectTaskRcdMap 包含实体信息的 Map 对象
	 * @return ProjectTaskRcd , 转换好的的 ProjectTaskRcd 对象
	*/
	@Transient
	public static ProjectTaskRcd createFrom(Map<String,Object> projectTaskRcdMap) {
		if(projectTaskRcdMap==null) return null;
		ProjectTaskRcd po = create();
		EntityContext.copyProperties(po,projectTaskRcdMap);
		po.clearModifies();
		return po;
	}

	/**
	 * 将 Pojo 转换成 ProjectTaskRcd
	 * @param pojo 包含实体信息的 Pojo 对象
	 * @return ProjectTaskRcd , 转换好的的 ProjectTaskRcd 对象
	*/
	@Transient
	public static ProjectTaskRcd createFrom(Object pojo) {
		if(pojo==null) return null;
		ProjectTaskRcd po = create();
		EntityContext.copyProperties(po,pojo);
		po.clearModifies();
		return po;
	}

	/**
	 * 创建一个 ProjectTaskRcd，等同于 new
	 * @return ProjectTaskRcd 对象
	*/
	@Transient
	public static ProjectTaskRcd create() {
		return new com.dt.platform.domain.oa.meta.ProjectTaskRcdMeta.$$proxy$$();
	}

	/**
	 * 从 Map 读取
	 * @param map 记录数据
	 * @param cast 是否用 DataParser 进行类型转换
	 * @return  是否读取成功
	*/
	public boolean read(Map<String, Object> map,boolean cast) {
		if(map==null) return false;
		if(cast) {
			this.setNotes(DataParser.parse(String.class, map.get(ProjectTaskRcdMeta.NOTES)));
			this.setETime(DataParser.parse(Date.class, map.get(ProjectTaskRcdMeta.E_TIME)));
			this.setUpdateTime(DataParser.parse(Date.class, map.get(ProjectTaskRcdMeta.UPDATE_TIME)));
			this.setOwnerId(DataParser.parse(String.class, map.get(ProjectTaskRcdMeta.OWNER_ID)));
			this.setVersion(DataParser.parse(Integer.class, map.get(ProjectTaskRcdMeta.VERSION)));
			this.setWorkTime(DataParser.parse(BigDecimal.class, map.get(ProjectTaskRcdMeta.WORK_TIME)));
			this.setCt(DataParser.parse(String.class, map.get(ProjectTaskRcdMeta.CT)));
			this.setCreateBy(DataParser.parse(String.class, map.get(ProjectTaskRcdMeta.CREATE_BY)));
			this.setDeleted(DataParser.parse(Integer.class, map.get(ProjectTaskRcdMeta.DELETED)));
			this.setCreateTime(DataParser.parse(Date.class, map.get(ProjectTaskRcdMeta.CREATE_TIME)));
			this.setDeleteTime(DataParser.parse(Date.class, map.get(ProjectTaskRcdMeta.DELETE_TIME)));
			this.setUpdateBy(DataParser.parse(String.class, map.get(ProjectTaskRcdMeta.UPDATE_BY)));
			this.setWorkType(DataParser.parse(String.class, map.get(ProjectTaskRcdMeta.WORK_TYPE)));
			this.setDeleteBy(DataParser.parse(String.class, map.get(ProjectTaskRcdMeta.DELETE_BY)));
			this.setId(DataParser.parse(String.class, map.get(ProjectTaskRcdMeta.ID)));
			this.setSTime(DataParser.parse(Date.class, map.get(ProjectTaskRcdMeta.S_TIME)));
			this.setProjectId(DataParser.parse(String.class, map.get(ProjectTaskRcdMeta.PROJECT_ID)));
			this.setTaskId(DataParser.parse(String.class, map.get(ProjectTaskRcdMeta.TASK_ID)));
			this.setWorkCatalog(DataParser.parse(String.class, map.get(ProjectTaskRcdMeta.WORK_CATALOG)));
			this.setFileId(DataParser.parse(String.class, map.get(ProjectTaskRcdMeta.FILE_ID)));
			this.setStatus(DataParser.parse(String.class, map.get(ProjectTaskRcdMeta.STATUS)));
			// others
			this.setOwner(DataParser.parse(Employee.class, map.get(ProjectTaskRcdMeta.OWNER)));
			this.setTask(DataParser.parse(ProjectTask.class, map.get(ProjectTaskRcdMeta.TASK)));
			this.setSelectRange(DataParser.parse(String.class, map.get(ProjectTaskRcdMeta.SELECT_RANGE)));
			this.setProject(DataParser.parse(Project.class, map.get(ProjectTaskRcdMeta.PROJECT)));
			this.setWorkTypeDict(DataParser.parse(DictItem.class, map.get(ProjectTaskRcdMeta.WORK_TYPE_DICT)));
			this.setTabStatus(DataParser.parse(String.class, map.get(ProjectTaskRcdMeta.TAB_STATUS)));
			return true;
		} else {
			try {
				this.setNotes( (String)map.get(ProjectTaskRcdMeta.NOTES));
				this.setETime( (Date)map.get(ProjectTaskRcdMeta.E_TIME));
				this.setUpdateTime( (Date)map.get(ProjectTaskRcdMeta.UPDATE_TIME));
				this.setOwnerId( (String)map.get(ProjectTaskRcdMeta.OWNER_ID));
				this.setVersion( (Integer)map.get(ProjectTaskRcdMeta.VERSION));
				this.setWorkTime( (BigDecimal)map.get(ProjectTaskRcdMeta.WORK_TIME));
				this.setCt( (String)map.get(ProjectTaskRcdMeta.CT));
				this.setCreateBy( (String)map.get(ProjectTaskRcdMeta.CREATE_BY));
				this.setDeleted( (Integer)map.get(ProjectTaskRcdMeta.DELETED));
				this.setCreateTime( (Date)map.get(ProjectTaskRcdMeta.CREATE_TIME));
				this.setDeleteTime( (Date)map.get(ProjectTaskRcdMeta.DELETE_TIME));
				this.setUpdateBy( (String)map.get(ProjectTaskRcdMeta.UPDATE_BY));
				this.setWorkType( (String)map.get(ProjectTaskRcdMeta.WORK_TYPE));
				this.setDeleteBy( (String)map.get(ProjectTaskRcdMeta.DELETE_BY));
				this.setId( (String)map.get(ProjectTaskRcdMeta.ID));
				this.setSTime( (Date)map.get(ProjectTaskRcdMeta.S_TIME));
				this.setProjectId( (String)map.get(ProjectTaskRcdMeta.PROJECT_ID));
				this.setTaskId( (String)map.get(ProjectTaskRcdMeta.TASK_ID));
				this.setWorkCatalog( (String)map.get(ProjectTaskRcdMeta.WORK_CATALOG));
				this.setFileId( (String)map.get(ProjectTaskRcdMeta.FILE_ID));
				this.setStatus( (String)map.get(ProjectTaskRcdMeta.STATUS));
				// others
				this.setOwner( (Employee)map.get(ProjectTaskRcdMeta.OWNER));
				this.setTask( (ProjectTask)map.get(ProjectTaskRcdMeta.TASK));
				this.setSelectRange( (String)map.get(ProjectTaskRcdMeta.SELECT_RANGE));
				this.setProject( (Project)map.get(ProjectTaskRcdMeta.PROJECT));
				this.setWorkTypeDict( (DictItem)map.get(ProjectTaskRcdMeta.WORK_TYPE_DICT));
				this.setTabStatus( (String)map.get(ProjectTaskRcdMeta.TAB_STATUS));
				return true;
			} catch (Exception e) {
				return false;
			}
		}
	}

	/**
	 * 从 Map 读取
	 * @param r 记录数据
	 * @param cast 是否用 DataParser 进行类型转换
	 * @return  是否读取成功
	*/
	public boolean read(ExprRcd r,boolean cast) {
		if(r==null) return false;
		if(cast) {
			this.setNotes(DataParser.parse(String.class, r.getValue(ProjectTaskRcdMeta.NOTES)));
			this.setETime(DataParser.parse(Date.class, r.getValue(ProjectTaskRcdMeta.E_TIME)));
			this.setUpdateTime(DataParser.parse(Date.class, r.getValue(ProjectTaskRcdMeta.UPDATE_TIME)));
			this.setOwnerId(DataParser.parse(String.class, r.getValue(ProjectTaskRcdMeta.OWNER_ID)));
			this.setVersion(DataParser.parse(Integer.class, r.getValue(ProjectTaskRcdMeta.VERSION)));
			this.setWorkTime(DataParser.parse(BigDecimal.class, r.getValue(ProjectTaskRcdMeta.WORK_TIME)));
			this.setCt(DataParser.parse(String.class, r.getValue(ProjectTaskRcdMeta.CT)));
			this.setCreateBy(DataParser.parse(String.class, r.getValue(ProjectTaskRcdMeta.CREATE_BY)));
			this.setDeleted(DataParser.parse(Integer.class, r.getValue(ProjectTaskRcdMeta.DELETED)));
			this.setCreateTime(DataParser.parse(Date.class, r.getValue(ProjectTaskRcdMeta.CREATE_TIME)));
			this.setDeleteTime(DataParser.parse(Date.class, r.getValue(ProjectTaskRcdMeta.DELETE_TIME)));
			this.setUpdateBy(DataParser.parse(String.class, r.getValue(ProjectTaskRcdMeta.UPDATE_BY)));
			this.setWorkType(DataParser.parse(String.class, r.getValue(ProjectTaskRcdMeta.WORK_TYPE)));
			this.setDeleteBy(DataParser.parse(String.class, r.getValue(ProjectTaskRcdMeta.DELETE_BY)));
			this.setId(DataParser.parse(String.class, r.getValue(ProjectTaskRcdMeta.ID)));
			this.setSTime(DataParser.parse(Date.class, r.getValue(ProjectTaskRcdMeta.S_TIME)));
			this.setProjectId(DataParser.parse(String.class, r.getValue(ProjectTaskRcdMeta.PROJECT_ID)));
			this.setTaskId(DataParser.parse(String.class, r.getValue(ProjectTaskRcdMeta.TASK_ID)));
			this.setWorkCatalog(DataParser.parse(String.class, r.getValue(ProjectTaskRcdMeta.WORK_CATALOG)));
			this.setFileId(DataParser.parse(String.class, r.getValue(ProjectTaskRcdMeta.FILE_ID)));
			this.setStatus(DataParser.parse(String.class, r.getValue(ProjectTaskRcdMeta.STATUS)));
			return true;
		} else {
			try {
				this.setNotes( (String)r.getValue(ProjectTaskRcdMeta.NOTES));
				this.setETime( (Date)r.getValue(ProjectTaskRcdMeta.E_TIME));
				this.setUpdateTime( (Date)r.getValue(ProjectTaskRcdMeta.UPDATE_TIME));
				this.setOwnerId( (String)r.getValue(ProjectTaskRcdMeta.OWNER_ID));
				this.setVersion( (Integer)r.getValue(ProjectTaskRcdMeta.VERSION));
				this.setWorkTime( (BigDecimal)r.getValue(ProjectTaskRcdMeta.WORK_TIME));
				this.setCt( (String)r.getValue(ProjectTaskRcdMeta.CT));
				this.setCreateBy( (String)r.getValue(ProjectTaskRcdMeta.CREATE_BY));
				this.setDeleted( (Integer)r.getValue(ProjectTaskRcdMeta.DELETED));
				this.setCreateTime( (Date)r.getValue(ProjectTaskRcdMeta.CREATE_TIME));
				this.setDeleteTime( (Date)r.getValue(ProjectTaskRcdMeta.DELETE_TIME));
				this.setUpdateBy( (String)r.getValue(ProjectTaskRcdMeta.UPDATE_BY));
				this.setWorkType( (String)r.getValue(ProjectTaskRcdMeta.WORK_TYPE));
				this.setDeleteBy( (String)r.getValue(ProjectTaskRcdMeta.DELETE_BY));
				this.setId( (String)r.getValue(ProjectTaskRcdMeta.ID));
				this.setSTime( (Date)r.getValue(ProjectTaskRcdMeta.S_TIME));
				this.setProjectId( (String)r.getValue(ProjectTaskRcdMeta.PROJECT_ID));
				this.setTaskId( (String)r.getValue(ProjectTaskRcdMeta.TASK_ID));
				this.setWorkCatalog( (String)r.getValue(ProjectTaskRcdMeta.WORK_CATALOG));
				this.setFileId( (String)r.getValue(ProjectTaskRcdMeta.FILE_ID));
				this.setStatus( (String)r.getValue(ProjectTaskRcdMeta.STATUS));
				return true;
			} catch (Exception e) {
				return false;
			}
		}
	}
}